package com.hdax.cart.vo;


import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

/**
 * 购物车的每个购物项
 */
@Data
public class CartItem {

    private Long skuId;

    private Boolean check= true;

    private String title;

    private String imges;

    private List<String> skuAttr;
    private BigDecimal price;

    private Integer count;

    private BigDecimal totalPrice;

    public Long getSkuId() {
        return skuId;
    }

    public void setSkuId(Long skuId) {
        this.skuId = skuId;
    }

    public Boolean getCheck() {
        return check;
    }

    public void setCheck(Boolean check) {
        this.check = check;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getImges() {
        return imges;
    }

    public void setImges(String imges) {
        this.imges = imges;
    }

    public List<String> getSkuAttr() {
        return skuAttr;
    }

    public void setSkuAttr(List<String> skuAttr) {
        this.skuAttr = skuAttr;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    /**
     * 求出单价
     * @return
     */
    public BigDecimal getTotalPrice() {
        //
        BigDecimal multiply = this.price.multiply(new BigDecimal("" + this.count));
        return multiply;
    }




}
